import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        int n = in.nextInt();
        String s = Integer.toBinaryString(n);
        int count=0;
        int finish=0;
        for(int i = 0;i<s.length()-1;i++){
            if(s.charAt(i)=='1'&&s.charAt(i+1)!='1'){
                count=1;
            }
            if(s.charAt(i)=='1'&&s.charAt(i+1)=='1'){
                finish=2;
            }
        }

        if(finish!=0){
            System.out.println(2);
        }
        else {
            System.out.println(count);
        }
    }
}